home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Skunkware 5
/
Skunkware 5.iso
/
man
/
cat.3
/
EnterFile.3
< prev
next >
Wrap
Text File
|
1995-07-25
|
7KB
|
133 lines
TTTTccccllll____EEEEnnnntttteeeerrrrFFFFiiiilllleeee((((3333)))) TTTTccccllll ((((7777....0000)))) TTTTccccllll____EEEEnnnntttteeeerrrrFFFFiiiilllleeee((((3333))))
_________________________________________________________________
NNNNAAAAMMMMEEEE
Tcl_EnterFile, Tcl_GetOpenFile, Tcl_FilePermissions -
manipulate the table of open files
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
####iiiinnnncccclllluuuuddddeeee <<<<ttttccccllll....hhhh>>>>
TTTTccccllll____EEEEnnnntttteeeerrrrFFFFiiiilllleeee(_i_n_t_e_r_p, _f_i_l_e, _p_e_r_m_i_s_s_i_o_n_s)
int
TTTTccccllll____GGGGeeeettttOOOOppppeeeennnnFFFFiiiilllleeee(_i_n_t_e_r_p, _s_t_r_i_n_g, _w_r_i_t_e, _c_h_e_c_k_U_s_a_g_e, _f_i_l_e_P_t_r)
int
TTTTccccllll____FFFFiiiilllleeeePPPPeeeerrrrmmmmiiiissssssssiiiioooonnnnssss((((_f_i_l_e)
AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
Tcl_Interp *_i_n_t_e_r_p (in) Tcl interpreter from
which file is to be
accessed.
FILE *_f_i_l_e (in) Handle for file that is
to become accessible in
_i_n_t_e_r_p.
int _p_e_r_m_i_s_s_i_o_n_s (in) OR-ed combination of
TCL_FILE_READABLE and
TCL_FILE_WRITABLE;
indicates whether _f_i_l_e
was opened for reading
or writing or both.
char *_s_t_r_i_n_g (in) String identifying file,
such as ssssttttddddiiiinnnn or ffffiiiilllleeee4444.
int _w_r_i_t_e (in) Non-zero means the file
will be used for
writing, zero means it
will be used for
reading.
int _c_h_e_c_k_U_s_a_g_e (in) If non-zero, then an
error will be generated
if the file wasn't
opened for the access
indicated by _w_r_i_t_e.
FILE **_f_i_l_e_P_t_r (out) Points to word in which
to store pointer to FILE
structure for the file
given by _s_t_r_i_n_g.
Page 1 (printed 7/10/95)
TTTTccccllll____EEEEnnnntttteeeerrrrFFFFiiiilllleeee((((3333)))) TTTTccccllll ((((7777....0000)))) TTTTccccllll____EEEEnnnntttteeeerrrrFFFFiiiilllleeee((((3333))))
_________________________________________________________________
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
These procedures provide access to Tcl's file naming
mechanism. TTTTccccllll____EEEEnnnntttteeeerrrrFFFFiiiilllleeee enters an open file into Tcl's
file table so that it can be accessed using Tcl commands
like ggggeeeettttssss, ppppuuuuttttssss, sssseeeeeeeekkkk, and cccclllloooosssseeee. It returns in _i_n_t_e_r_p-
>_r_e_s_u_l_t an identifier such as ffffiiiilllleeee4444 that can be used to
refer to the file in subsequent Tcl commands. TTTTccccllll____EEEEnnnntttteeeerrrrFFFFiiiilllleeee
is typically used to implement new Tcl commands that open
sockets, pipes, or other kinds of files not already
supported by the built-in commands.
TTTTccccllll____GGGGeeeettttOOOOppppeeeennnnFFFFiiiilllleeee takes as argument a file identifier of the
form returned by the ooooppppeeeennnn command or TTTTccccllll____EEEEnnnntttteeeerrrrFFFFiiiilllleeee and
returns at *_f_i_l_e_P_t_r a pointer to the FILE structure for the
file. The _w_r_i_t_e argument indicates whether the FILE pointer
will be used for reading or writing. In some cases, such as
a file that connects to a pipeline of subprocesses,
different FILE pointers will be returned for reading and
writing. TTTTccccllll____GGGGeeeettttOOOOppppeeeennnnFFFFiiiilllleeee normally returns TCL_OK. If an
error occurs in TTTTccccllll____GGGGeeeettttOOOOppppeeeennnnFFFFiiiilllleeee (e.g. _s_t_r_i_n_g didn't make any
sense or _c_h_e_c_k_U_s_a_g_e was set and the file wasn't opened for
the access specified by _w_r_i_t_e) then TCL_ERROR is returned
and _i_n_t_e_r_p->_r_e_s_u_l_t will contain an error message. If
_c_h_e_c_k_U_s_a_g_e is zero and the file wasn't opened for the access
specified by _w_r_i_t_e, then the FILE pointer returned at
*_f_i_l_e_P_t_r may not correspond to _w_r_i_t_e.
TTTTccccllll____FFFFiiiilllleeeePPPPeeeerrrrmmmmiiiissssssssiiiioooonnnnssss returns an OR-ed combination of the mask
bits TCL_FILE_READABLE and TCL_FILE_WRITABLE; these indicate
whether the given file was opened for reading or writing or
both. If _f_i_l_e does not refer to a file in Tcl's file table
then -1 is returned.
KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
file table, permissions, pipeline, read, write
Page 2 (printed 7/10/95)